package models;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import play.db.jpa.Model;

@Entity
@Table(name = "EffortUnits_Projects", uniqueConstraints = { @UniqueConstraint(columnNames = {
		"unit_id", "project_id" }) })
public class EffortUnitProject extends Model {

	public boolean isSelected;

	@ManyToOne
	@JoinColumn(name = "unit_id")
	public EffortUnit unit;

	@ManyToOne
	@JoinColumn(name = "project_id")
	public Project project;

	public EffortUnitProject(boolean isSelected, EffortUnit unit,
			Project project) {
		this.isSelected = isSelected;
		this.unit = unit;
		this.project = project;
	}
}
